<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@include file="/common/common.jspf"%>
<script type="text/javascript" src="${ctx}/js/client/client_person_add.js"></script>
<style type="text/css">
.col-sm-3 {
	width: 15%;
	float: left;
}

.col-sm-9 {
	width: 85%;
	float: left;
}

label[class^="btn btn-default"] {
	margin-top: -4px;
}
</style>
<script type="text/javascript">
	$(function(){
		$("#accountName").change(function(){
			var accountname=$(this).val();
			var ret=/^[A-Za-z]+$/;
			if(!ret.test(accountname)){
				alert("请输入，英文字符！");
				$("#accountName").val('');
			}
			$.get(rootPath +"/internalstaff/user_isExist.shtml?accountName="+$(this).val(),function(data){
				if(data=='false'){
					alert("该用户已存在！");
					$("#accountName").val('');
				}
			});
		});
	});
</script>
</head>
<body>
	<div class="l_err" style="width: 100%; margin-top: 2px;"></div>
	<form id="form" name="form" class="form-horizontal" method="post"
		action="${ctx}/clientAccount/clientperson_addInfo.shtml">
		<section class="panel panel-default">
		<div class="panel-body">
			<div class="line line-dashed line-lg pull-in"></div>
				<div class="form-group">
					<label class="col-sm-3 control-label">用户名</label>
					<div class="col-sm-9">
						<input type="text" class="form-control accountName" id="accountName" 
							 name="userFormMap.accountName" />
					</div>
				</div>
				<div class="line line-dashed line-lg pull-in"></div>
				<div class="form-group">
					<label class="col-sm-3 control-label">昵称</label>
					<div class="col-sm-9">
						<input type="text" class="form-control username"
							 name="userFormMap.userName" />
					</div>
				</div>
				<div class="line line-dashed line-lg pull-in"></div>
				<div class="form-group">
					<label class="col-sm-3 control-label">个人说明</label>
					<div class="col-sm-9">
						<input type="text" class="form-control username"
							 name="userFormMap.description" />
					</div>
				</div>
				
				<div class="line line-dashed line-lg pull-in"></div>
				<div class="form-group">
					<label class="col-sm-3 control-label">客户</label>
					<div class="col-sm-9">
						<select style="width: 30%;" class="form-control" id="client" name="userFormMap.client_id">
							
							<c:forEach var="key" items="${client}" >
								<option value="${key.id }" ${key.id==userEntity.client_id?'selected':'' }>${key.name }</option>	
							</c:forEach>
						</select>
					</div>
				</div>
			</div>
		<footer class="panel-footer text-right bg-light lter">
				<button type="submit" class="btn btn-success btn-s-xs">确认</button>
		</footer>
	 </section>
	</form>
</body>
</html>